# system("python Wvfn(t,x).py")


d <- read.csv(file="./wvfn.csv",head=FALSE,sep=",")

t <- d$V1
x <- d$V2
rho <- d$V4

ex = seq(min(t),max(t),length=200)
why = seq(min(x),max(x),length=200)

library(akima)
zz <- interp(t,x,-rho,xo=ex,yo=why)

pdf("./contour.pdf") # makes a pdf printing device for the plot
filled.contour(zz,xlab="Time",ylab="Position",ylim=c(-4,4),col=rainbow(16,start=0/6,end=4/6))

warnings()

dev.off() #closes the pdf printing device

# then convert *.pdf to a .gif with whichever software one wants (platform-dependent)

#system("convert ./plots/*.pdf SHO.gif")